# -*- coding: utf-8 -*-
"""
Created on Wed May 15 16:58:56 2019

@author: yaoyu
"""

if 0:
    a = {1, 2, 3, 4}
    b = {2, 3, 5, 6}
    print(a.issubset(b))
    print(a.difference(b) == a - b)
    print(a.union(b) == a | b)
    
    dict_mark = {'Wang': 'C', 'Li': 'B', 'Ma': 'A'}
    s = ''
    for c in dict_mark.values():
            s += c
    print(s)
    
    
    from pandas import Series
    sa = Series(['a', 'b', 'c'], index = [0, 1, 2])
    sb = Series(['a', 'b', 'c'])
    sc = Series(['a', 'c', 'b'])
    print(sa.equals(sc))
    print(sb.equals(sa))

    
    from pandas import Series, DataFrame
    data = {'language': ['Java', 'PHP', 'Python', 'R', 'C#'],
                'year': [ 1995 ,  1995 , 1991   ,1993, 2000]}
    frame = DataFrame(data)
    frame['IDE'] = Series(['Intellij', 'Notepad', 'IPython', 'R studio', 'VS'])
    print(list(frame['IDE']))
    print('VS' in frame['IDE'])
    print(frame['year'][2])
    
    dict_mark_1 = {'Wang': 98, 'Li': 87, 'Ma': 93}
    dict_mark_2 = {'Li': 90, 'Ma': 95, 'Xu': 75}
    dict_mark_1.update(dict_mark_2)
    print(dict_mark_1.pop('Li'))
        
    color = {"色彩":[
                       {"暖色":["红","橙","黄"]},
                       {"冷色":["青","蓝"]},
                       {"中性色":["紫","绿","黑","灰","白"]}
             ]}
    print(color['色彩'][1]['冷色'])
    
import numpy as np
a = np.array([(1, 2, 3), (4, 5, 6), (7, 8, 9)])
print(a.shape)
print(a[[2]].sum())

